import { getDispatch } from '../dva';
import Taro from '@tarojs/taro';

function getAppConfig() {
  const dispatch = getDispatch();

  // 延迟执行, reducers.setAppConfig 才能设置成功
  setTimeout(() => {
    dispatch({
      type: 'otherApi/getAppConfig',
      payload: Taro.$sassAppId,
    });
  }, 0);
}

export { getAppConfig };
